/**
 * Copyright (C), 2020-2021 by colley.ma
 * File Name: LockConst.java
 * Encoding: UTF-8
 * Date: 2021年12月28日 下午3:43:44
 * History:
 */
package com.swak.frame.lock;

public final class LockConst {

    // script 删除锁的脚本
    protected static final String UNLOCK_SCRIPT =
        "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('del', KEYS[1]) else return 0 end";

    // script 锁续租脚本
    protected static String RENEWAL_SCRIPT =
        "if redis.call('get', KEYS[1]) == ARGV[1] then return redis.call('pexpire', KEYS[1], ARGV[2]) else return 0 end";

    // 重试次数
    protected static int MAX_RETRY_TIME = 2;

    // 默认失效时间
    protected static int DEFAULT_EXPIRETIME = 300;
}
